package cn.silver.module.authority.bean;

import cn.silver.framework.core.utils.DateUtils;
import cn.silver.framework.mybatis.bean.BusBean;
import cn.silver.module.authority.domain.SysTenant;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;


/**
 * 租户视图对象 sys_tenant
 *
 * @author Silver Zhou
 */
@Data
@NoArgsConstructor
@ExcelIgnoreUnannotated
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SysTenant.class)
@Schema(name = "TenantModel", title = "系统租户对象")
public class TenantBean extends BusBean implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 域名
     */
    @Schema(title = "域名")
    @ExcelProperty(value = "域名")
    private String domain;


    /**
     * 租户套餐编号
     */
    @Schema(title = "租户套餐编号")
    private String groupId;
    /**
     * 注册时间
     */
    @Schema(title = "注册时间")
    @ExcelProperty(value = "注册时间")
    @JsonFormat(timezone = DateUtils.TIME_ZONE, pattern = DateUtils.YYYY_MM_DD)
    private Date startTime;
    /**
     * 过期时间
     */
    @Schema(title = "过期时间")
    @ExcelProperty(value = "过期时间")
    @DateTimeFormat(DateUtils.YYYY_MM_DD)
    @JsonFormat(timezone = DateUtils.TIME_ZONE, pattern = DateUtils.YYYY_MM_DD)
    private Date stopTime;

    /**
     * 用户数量（-1不限制）
     */
    @Schema(title = "用户数量")
    @ExcelProperty(value = "用户数量")
    private Long capacity;
}
